#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>


int main(){

	pid_t pid;
	int data = 10;

	while(1){
			
		printf("please input a data:\n");
		scanf("%d",&data);

		if(data == 1){
			
			pid = fork();
			
			if(pid == 0){
					
				while(1){
	
					printf("this is child process,pid = %d\n",getpid());
					sleep(3);
				}
			}
			else if(pid > 0){
				
			}
		}
		else{
			printf("waiting ...\n");
		}
	}

	return 0;
}
